﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Catering_Rules
{
    public class ChargePersonNumber
    {
        private readonly Catering_Operation.ChargePersonNumber dal = new Catering_Operation.ChargePersonNumber();
        public ChargePersonNumber() { }
        #region  Method

        /// <summary>
        /// 得到最大ID
        /// </summary>
        public int GetMaxId()
        {
            return dal.GetMaxId();
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int id)
        {
            return dal.Exists(id);
        }

        public bool Exists(int classid, int year, int month)
        {
            return dal.Exists(classid, year, month);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Catering_Model.ChargePersonNumber model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(int number, int id)
        {
            return dal.Update(number, id);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(int number, int classid, int year, int month)
        {
            return dal.Update(number, classid, year, month);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Catering_Model.ChargePersonNumber GetModel(int id)
        {
            return dal.GetModel(id);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        /// <param name="classid"></param>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <returns></returns>
        public Catering_Model.ChargePersonNumber GetModel(int classid, int year, int month)
        {
            return dal.GetModel(classid, year, month);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        public int GetChargePersonNumberByClassIDAndDate(int classID, int year, int month)
        {
            return dal.GetChargePersonNumberByClassIDAndDate(classID, year, month);
        }

        #endregion  Method
    }
}
